/*
 * Copyright 2011-2012 by The Regents of the University of California Licensed
 * under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. you may obtain a copy of the
 * License from
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package edu.ucsd.db.bassarisk.indexer.api;

import edu.ucsd.db.bassarisk.data.api.IValueType.IValueReference;
import edu.ucsd.db.bassarisk.indexer.api.IPosting.IPositionedPosting;
import edu.ucsd.db.bassarisk.indexer.api.IPosting.ISequencedPosting;

public interface IPostingFactory {

  ISequencedPosting int32ValuePosting(String groupKey, String tokenKey, int value);

  IPositionedPosting int32ValuePosting(String groupKey, String tokenKey, int value,
                                       int position);

  ISequencedPosting int64ValuePosting(String groupKey, String tokenKey, long value);

  IPositionedPosting int64ValuePosting(String groupKey, String tokenKey, long value,
                                       int position);

  IPositionedPosting
      makeTokenPosting(String groupKey, String tokenKey, int position);

  ISequencedPosting posting(String groupKey, String tokenKey,
                            IValueReference<?> value, boolean consumesPosition);

  IPositionedPosting posting(String groupKey, String tokenKey,
                             IValueReference<?> value, int position);

  ISequencedPosting runEnd(String groupKey);

  IPositionedPosting runEnd(String groupKey, int position);

  ISequencedPosting runStart(String groupKey);

  IPositionedPosting runStart(String groupKey, int position);

  ISequencedPosting
      stringValuePosting(String groupKey, String tokenKey, String value);

  IPositionedPosting stringValuePosting(String groupKey, String tokenKey,
                                        String value, int position);

  ISequencedPosting tokenPosting(String tokenKey);

  IPositionedPosting tokenPosting(String tokenKey, int position);

  ISequencedPosting tokenPosting(String groupKey, String tokenKey);

}
